package com.springtest.thread;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * project : my-learn
 * <p> Thread测试 </p>
 *
 * @author yisl
 * @date 2022-06-10【星期五】
 **/
public class TestCase {
    public static void main(String[] args) {

        Thread thread1 = new Thread(new MyRunnable());
        thread1.start();

        FutureTask futureTask = new FutureTask(new MyCallable());
        Thread thread2 = new Thread(futureTask);
        thread2.start();

        MyThread myThread = new MyThread();
        myThread.start();



    }




}

class MyRunnable implements Runnable {
    @Override
    public void run() {
        System.out.println("Test MyRunnable");
    }
}

class MyCallable implements Callable {
    @Override
    public Object call() throws Exception {
        System.out.println("Test MyCallable");
        return null;
    }
}

class MyThread extends Thread{
    @Override
    public void run() {
        System.out.println("Test MyThread");
    }
}
